package org.gpf.singleton;
/**
 * 取得单态模式的实例的时候加锁，使懒汉模式线程安全，但牺牲了效率
 * @author gaopengfei
 * @date 2015-4-21 下午12:53:30
 */
public class Singleton3 {

	private static Singleton3 singleton = null;
	
	private Singleton3() {
		
	}
	
	public synchronized static Singleton3 getInstance(){
		
		if(singleton == null)
			singleton = new Singleton3();
		return singleton;
	}
}
